﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:Controls="clr-namespace:Coding4Fun.Toolkit.Controls;assembly=Coding4Fun.Toolkit.Controls"
    x:Class="A_larm_Shake.page_clock"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">
    <phone:PhoneApplicationPage.Resources>
        <SolidColorBrush x:Key="Brush2" Color="#FF2C4566"/>
        <SolidColorBrush x:Key="Brush3" Color="#FFAA4344"/>
        <SolidColorBrush x:Key="Brush4" Color="#FF1F2932"/>
        <SolidColorBrush x:Key="Brush5" Color="#FF2C4566" Opacity="2.55"/>
    </phone:PhoneApplicationPage.Resources>
    <phone:PhoneApplicationPage.FontFamily>
        <StaticResource ResourceKey="PhoneFontFamilyNormal"/>
    </phone:PhoneApplicationPage.FontFamily>
    <phone:PhoneApplicationPage.FontSize>
        <StaticResource ResourceKey="PhoneFontSizeNormal"/>
    </phone:PhoneApplicationPage.FontSize>
    <phone:PhoneApplicationPage.Background>
        <StaticResource ResourceKey="Brush1"/>
    </phone:PhoneApplicationPage.Background>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar BackgroundColor="#FF1699DD" Mode="Default">
            <shell:ApplicationBarIconButton x:Name="new_alarm" IconUri="/Assets/AppBar/edit.png" Text="new" Click="new_alarm_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="#FF1699DD" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="599*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0" Margin="15,17,15,0" Background="#FF01669A" Height="36" VerticalAlignment="Top" >
            <TextBlock Text="Alarm Shake" Style="{StaticResource PhoneTextNormalStyle}" FontSize="20" HorizontalAlignment="Left" Foreground="White" />
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="15,0,15,10" Grid.RowSpan="2">
            <Grid.Background>
                <SolidColorBrush Color="#FF11A8AB" Opacity="2.5499999523162842"/>
            </Grid.Background>
            <Grid Margin="0,451,0,10" HorizontalAlignment="Center">
                <TextBlock x:Name="tbx2" HorizontalAlignment="Left" TextWrapping="Wrap" Text="-" VerticalAlignment="Top" Margin="68,73,0,0" Foreground="White"/>
                <toolkit:ToggleSwitch x:Name="tg" Header="Set Time" HorizontalAlignment="Center" Width="359"  Checked="switch_Checked" Unchecked="switch_Unchecked">
                    <toolkit:ToggleSwitch.HeaderTemplate>
                        <DataTemplate>
                            <ContentControl FontSize="{StaticResource PhoneFontSizeLarge}" Foreground="{StaticResource PhoneForegroundBrush}" Content="{Binding}"/>
                        </DataTemplate>
                    </toolkit:ToggleSwitch.HeaderTemplate>
                    <toolkit:ToggleSwitch.ContentTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="Alarm : " FontSize="{StaticResource PhoneFontSizeSmall}"/>
                                    <ContentControl HorizontalAlignment="Left" FontSize="{StaticResource PhoneFontSizeSmall}" Content="{Binding}"/>
                                </StackPanel>
                                <TextBlock Text="Level : " FontSize="{StaticResource PhoneFontSizeSmall}" Foreground="{StaticResource PhoneSubtleBrush}"/>
                            </StackPanel>
                        </DataTemplate>
                    </toolkit:ToggleSwitch.ContentTemplate>
                </toolkit:ToggleSwitch>


                <TextBlock x:Name="chk_eh" HorizontalAlignment="Center" TextWrapping="Wrap" Text="00" VerticalAlignment="Top" FontSize="36" Margin="10,100,189,0" Width="160" Foreground="#99808080"/>
            </Grid>
            <toolkit:TimePicker  x:Name="timeSpan1" ValueStringFormat="{}{0:HH:mm}"  HorizontalAlignment="Center" Margin="158,78,150,452" Width="142" FontWeight="Bold" FontSize="36" Visibility="Collapsed"/>
            <Controls:TimeSpanPicker x:Name="timeSpan" Value="0" Margin="158,140,150,392" Visibility="Collapsed"/>
            <MediaElement x:Name="mesound" HorizontalAlignment="Left" Height="38" Margin="342,197,0,0" VerticalAlignment="Top" Width="82" Source="/Assets/alarm_sound.mp3" AutoPlay="False" Volume="1" BufferingTime="0:0:10" />
            <TextBlock x:Name="chk_nh" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Margin="46,21,0,0" FontSize="48" Height="77" Width="378" TextAlignment="Center" Text="---"/>
            <TextBlock x:Name="tbx3" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Margin="360,158,0,0" FontSize="48" Height="77" Width="64" TextAlignment="Center" Visibility="Collapsed">
            	<Run Text="00"/>
            	<LineBreak/>
            	<Run/>
            </TextBlock>
            <Image x:Name="meter" HorizontalAlignment="Center" Height="108" Margin="183,197,163,0" VerticalAlignment="Top" Width="104" Source="/Assets/2.png"/>
        </Grid>
        <TextBlock x:Name="tg_val" HorizontalAlignment="Left" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Margin="59,294,0,0" Grid.Row="1" Visibility="Collapsed"/>
    </Grid>
</phone:PhoneApplicationPage>